'use strict';
module.exports = (app) => {
  // 城市表
  const { STRING, INTEGER } = app.Sequelize;
  const City = app.model.define(
    'city',
    {
      id: { type: INTEGER, primaryKey: true, autoIncrement: true },
      pid: {
        type: INTEGER,
        comment: '父级id',
      },
      cityname: {
        type: STRING,
        comment: '城市名',
      },
      type: {
        type: INTEGER,
        comment: '层级 1 2 3',
      },
    },
    {
      // 不想要 createdAt、updatedAt
      createdAt: false,
      updatedAt: false,
    }
  );

  // (async () => {
  //   await City.sync({ alter: true });
  // })();

  return City;
};
